/**
 * 
 */
package com.easidea.tim.dao.finance;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springside.core.dao.extend.HibernateEntityExtendDao;

import com.easidea.tim.entity.finance.FinanceItem;

/**
 * @author Harrison
 *
 */
public class FinanceItemDao extends HibernateEntityExtendDao<FinanceItem> {
	
	/**
	 * 获取销售出货科目
	 * @return
	 */
	public FinanceItem getSalesAccountItem(){
		Criteria cte = createUnDeletedCriteria();
		cte.add(Restrictions.eq("direction",Short.valueOf("999")));
		cte.setFetchSize(1);
		return (FinanceItem)cte.uniqueResult();
	}
	
	/**
	 * 获取销售退货的科目
	 * @return
	 */
	public FinanceItem getSalesReturnAccountItem(){
		Criteria cte = createUnDeletedCriteria();
		cte.add(Restrictions.eq("name","退货结算"));
		cte.setFetchSize(1);
		return (FinanceItem)cte.uniqueResult();
	}
}
